#encoding: utf-8 
require 'rubygems'
require 'uri'
require 'net/http'

namespace :db do
  namespace :licenses do
    task :generate => :environment do
			2100.times.each do |i|
				date = Time.now.strftime("%Y%m%d")
				seq = '%0.4d' % i
				mac = date.to_s + seq.to_s
				license = License.new :mac => mac, :code => 'CSST-200', :batch => date
				license.save
				puts license.mac
			end
    end
  end
end
